import http from '@/utils/request'
import { AppDispatch } from '..'

export const getComments =
  ({ type = 'a', source = '' }) =>
  async (dispatch: AppDispatch) => {
    const res = await http.get('/v1_0/comments', { params: { type, source } })
    console.log(res)

    dispatch({ type: 'comment/saveComments', payload: res.data })
  }
